#include<iostream>
#include<string>
using namespace std;

bool isSubstring(string s1,string s2)
{
	if(s1.find(s2)!=string::npos) return true;
	else return false;
}

bool isRotation(string s1,string s2)
{
	if( s1.length()!=s2.length() ) return false;
	string s1s1=s1+s1;
	return isSubstring(s1s1,s2);
}


int main()
{
	string s1="apple",s2="pleap";
	string s3="waterbottle",s4="bottlewater";
	string s5="apple",s6="ppale";

	if(isRotation(s1,s2)) cout<<"isRotation"<<endl;
	else cout<<"notRotation"<<endl;
	if(isRotation(s3,s4)) cout<<"isRotation"<<endl;
	else cout<<"notRotation"<<endl;
	if(isRotation(s5,s6)) cout<<"isRotation"<<endl;
	else cout<<"notRotation"<<endl;
	return 0;
}
